package com.ruoyi.tjbb.controller;

import java.util.List;
import javax.servlet.http.HttpServletResponse;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.tjbb.domain.SysTjbbSpczcs;
import com.ruoyi.tjbb.service.ISysTjbbSpczcsService;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.common.core.page.TableDataInfo;

/**
 * 视频操作次数Controller
 * 
 * @author ruoyi
 * @date 2023-09-26
 */
@RestController
@RequestMapping("/tjbb/dmttj/spczcs")
public class SysTjbbSpczcsController extends BaseController
{
    @Autowired
    private ISysTjbbSpczcsService sysTjbbSpczcsService;

    /**
     * 查询视频操作次数列表
     */
    @PreAuthorize("@ss.hasPermi('tjbb/dmttj:spczcs:list')")
    @GetMapping("/list")
    public TableDataInfo list(SysTjbbSpczcs sysTjbbSpczcs)
    {
        startPage();
        List<SysTjbbSpczcs> list = sysTjbbSpczcsService.selectSysTjbbSpczcsList(sysTjbbSpczcs);
        return getDataTable(list);
    }

    /**
     * 导出视频操作次数列表
     */
    @PreAuthorize("@ss.hasPermi('tjbb/dmttj:spczcs:export')")
    @Log(title = "视频操作次数", businessType = BusinessType.EXPORT)
    @PostMapping("/export")
    public void export(HttpServletResponse response, SysTjbbSpczcs sysTjbbSpczcs)
    {
        List<SysTjbbSpczcs> list = sysTjbbSpczcsService.selectSysTjbbSpczcsList(sysTjbbSpczcs);
        ExcelUtil<SysTjbbSpczcs> util = new ExcelUtil<SysTjbbSpczcs>(SysTjbbSpczcs.class);
        util.exportExcel(response, list, "视频操作次数数据");
    }

    /**
     * 获取视频操作次数详细信息
     */
    @PreAuthorize("@ss.hasPermi('tjbb/dmttj:spczcs:query')")
    @GetMapping(value = "/{id}")
    public AjaxResult getInfo(@PathVariable("id") Long id)
    {
        return success(sysTjbbSpczcsService.selectSysTjbbSpczcsById(id));
    }

    /**
     * 新增视频操作次数
     */
    @PreAuthorize("@ss.hasPermi('tjbb/dmttj:spczcs:add')")
    @Log(title = "视频操作次数", businessType = BusinessType.INSERT)
    @PostMapping
    public AjaxResult add(@RequestBody SysTjbbSpczcs sysTjbbSpczcs)
    {
        return toAjax(sysTjbbSpczcsService.insertSysTjbbSpczcs(sysTjbbSpczcs));
    }

    /**
     * 修改视频操作次数
     */
    @PreAuthorize("@ss.hasPermi('tjbb/dmttj:spczcs:edit')")
    @Log(title = "视频操作次数", businessType = BusinessType.UPDATE)
    @PutMapping
    public AjaxResult edit(@RequestBody SysTjbbSpczcs sysTjbbSpczcs)
    {
        return toAjax(sysTjbbSpczcsService.updateSysTjbbSpczcs(sysTjbbSpczcs));
    }

    /**
     * 删除视频操作次数
     */
    @PreAuthorize("@ss.hasPermi('tjbb/dmttj:spczcs:remove')")
    @Log(title = "视频操作次数", businessType = BusinessType.DELETE)
	@DeleteMapping("/{ids}")
    public AjaxResult remove(@PathVariable Long[] ids)
    {
        return toAjax(sysTjbbSpczcsService.deleteSysTjbbSpczcsByIds(ids));
    }
}
